
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_study_app/page/visit_statistics_page.dart';
import 'package:flutter_study_app/widget/tab_app_bar.dart';

class DataStatisticsPage extends StatefulWidget{

  @override
  State<StatefulWidget> createState() => _DataStatisticsState();

}

class _DataStatisticsState extends State with SingleTickerProviderStateMixin {
  late TabController _tabController;

  @override
  void initState() {

    super.initState();
    _tabController = new TabController(vsync: this, length: 3);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: TabAppBar(
        tabs: [
          Text('走访统计'),
          Text('交叉引荐'),
          Text('引流统计')
        ],
        tabController: _tabController,
      ),
      body: TabBarView(
        controller: _tabController,
        physics: NeverScrollableScrollPhysics(),
        children: [
          VisitStatisticsPage(),
          Center(child: Text('Page02'),),
          Center(child: Text('Page03'),)
        ],
      ),
    );
  }

}